fix(resolution): resolve ES imports targeting .xsjs/.xsjslib files (#556)#594
Open
maxmilian wants to merge 1 commit into
Open
fix(resolution): resolve ES imports targeting .xsjs/.xsjslib files (#556)#594maxmilian wants to merge 1 commit into
maxmilian wants to merge 1 commit into
Conversation
1564c6a to
b31c3f0
Compare
b31c3f0 to
db95d38
Compare
…olbymchenry#556) The extraction half of colbymchenry#556 — indexing `.xsjs` / `.xsjslib` as JavaScript — already landed on main via colbymchenry#654. This PR is now scoped to the remaining resolution gap: the JS import-resolution list did not include the SAP HANA extensions, so an extensionless `import { x } from './helpers'` in a `.xsjs` file resolved to nothing and the cross-file call edge was dropped. Add `.xsjs` / `.xsjslib` to the `javascript` entry in EXTENSION_RESOLUTION so those imports resolve to their target file and `codegraph_callers` / `codegraph_impact` see the edge. One resolution test covers the .xsjs -> .xsjslib import; the now-redundant extraction/detection tests were dropped (covered by colbymchenry#654).
db95d38 to
9ad4224
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The headline of #556 — indexing SAP HANA
.xsjs/.xsjslibfiles as JavaScript — already shipped onmainvia #654 (the extension map + detection + extraction tests, credited to #556). This PR has been rebased and slimmed to the one piece #654 did not cover: import resolution.Remaining gap
EXTENSION_RESOLUTION.javascriptinsrc/resolution/import-resolver.tsdid not list.xsjs/.xsjslib, so an extensionless ES import from an xsjs file —resolved to nothing. The cross-file call edge was dropped, so
codegraph_callers/codegraph_impactreported the imported symbol as having no callers even though the import is live.Fix
Add
.xsjs,.xsjslibto thejavascriptentry inEXTENSION_RESOLUTION(one line). Now./helpersresolves tohelpers.xsjsliband the call edge is created.Tests
.xsjs->.xsjslibES import produces a cross-file call edge (run()->buildQuery). Passes.detectLanguage('service.xsjs'),extractFromSource('service.xsjs', …)).Scope
Resolution only. The grammar/extension map is untouched here since #654 owns it now.